﻿@using KRM.Core

@using KRM.Core.Library
@model System.Collections.Generic.List<KRM.Core.tblBookNotification>

@{
    ViewBag.Title = "All notification";
    Layout = "/views/shared/_HRLayout.cshtml";
       var currentUser = Users.Current(User.Identity.Name);
       ViewBag.UrlLink = "home";
}
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title">
            Notification <small>All notification</small>
        </h3>
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <i class="icon-home"></i>
                <a href="/Home">Home</a> 
                <span class="icon-angle-right"></span>
            </li>
            <li>
                <a href="#">Notification</a>
            </li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        @Html.Partial("Partial/_MessageResult")
    </div>
    <div class="col-md-12 table-toolbar" >
        <form class="form-horizontal row" id="frFilterActivities" action="/Home/AllActivities" method="GET">
            <label class="control-label col-md-2">Filter by date:</label>
            <div class="input-icon col-md-4">
                <i class="icon-calendar"></i>
                <input name="date"  class="form-control date-picker" size="16" type="text" value="@(Request["date"]??DateTime.Now.ToString("MM/dd/yyyy"))" data-date="@DateTime.Now.ToString("MM/dd/yyyy")" data-date-format="mm/dd/yyyy" data-date-viewmode="years">
            </div>
            <div class="col-md-2"><button type="submit" class="btn blue">Filter <i class="m-icon-swapright m-icon-white"></i></button></div>
        </form>
    </div>
    <div class="col-md-12">
       <table class="table table-striped table-bordered table-hover dataTable table-activities">
                          <thead>
                              <tr>
                                  <th>Activities</th>
                                  <th>Action</th>
                                  <th>Date create</th>
                              </tr>
                          </thead>
                          <tbody>
             @foreach (var item in Model)
             {
                    var owner = @item.tblBook.PersonalId == @currentUser.HRPersonalId;
                    <tr>
                               
                        <td>
                            <img src="/Upload/Avatar/@(item.tblPersonalFrom.Image??"avatar-default.jpg")" class="img-leaveToday">
                                  <a href="@(owner?"/HolidayRequest/ViewHolidayRequest/":"/Holidaymanagement/ViewHolidayRequest/")@item.BookId" class="from">@item.tblPersonalFrom.FullName </a>
                                        @Html.Raw(@item.HtmlNotification(User.Identity.Name))
                                    </td>
                                      <td style="text-align: center"> <p class="activites-action"><span class="@item.tblBookCommentType.LabelClass"> @(item.tblBookCommentType == null ? "" : item.tblBookCommentType.Name)</span></p></td>
                                      <td style="text-align: center">@item.DateCreated</td>
                                  </tr>
                              }
                          </tbody>
           </table>
    </div>
</div>